package com.touna.json;

import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.JSONPath;

import java.util.Iterator;
import java.util.Map;
import java.util.Set;

/**
 * @author: xiaoli
 * @date: 2019/1/19 14:50
 * @Desc:
 **/
public class JonTest {


    public static void main(String[] args) {
        String  jsonstr = "{\"Res_Loan_Time[40]\":\"\",\"Res_RuleDesc[4]\":\"\",\"Res_ProRE[22]\":\"\",\"Res_ProRE[34]\":\"\",\"Res_ProRE[46]\":\"\",\"ExpScore_ID[11]\":11,\"Res_ProRE[10]\":\"\",\"ExpScore_ID[23]\":23,\"Res_RuleDesc[29]\":\"\",\"ExpScore_Value[5]\":\"未知\",\"Res_RuleDesc[17]\":\"\",\"ExpScore_ID[8]\":8,\"Res_InsuranceDeductions\":0,\"ExpScore_Score[4]\":18,\"Res_Loan_Time[9]\":\"\",\"Res_ProRE[33]\":\"\",\"Res_ProRE[45]\":\"\",\"Res_RuleDesc[5]\":\"\",\"ExpScore_ID[24]\":24,\"ExpScore_Score[19]\":14,\"Res_ProRE[21]\":\"\",\"ExpScore_ID[12]\":12,\"ExpScore_ID[9]\":9,\"Res_RuleDesc[28]\":\"\",\"Res_RuleDesc[16]\":\"\",\"ExpScore_Value[6]\":\"未知\",\"ExpScore_Score[3]\":10,\"ExpScore_Value[19]\":\"未知\",\"Res_Loan_Time[50]\":\"\",\"ExpScore_Dimension[19]\":\"车辆特征\",\"Res_ProRE[44]\":\"\",\"Res_RuleDesc[6]\":\"\",\"ExpScore_ID[13]\":13,\"ExpScore_ID[25]\":25,\"Res_ProRE[20]\":\"\",\"Res_ProRE[32]\":\"\",\"ExpScore_Score[18]\":12,\"Res_RuleDesc[15]\":\"\",\"Res_RuleDesc[39]\":\"\",\"ExpScore_Value[3]\":\"未知\",\"Res_RuleDesc[27]\":\"\",\"ExpScore_Score[2]\":11,\"Res_AnnualPay\":0,\"ExpScore_Value[18]\":\"未知\",\"ExpScore_Score[17]\":18,\"Res_Delegation\":\"\",\"Res_RuleDesc[7]\":\"\",\"ExpScore_ID[26]\":26,\"ExpScore_ID[14]\":14,\"Res_ProRE[31]\":\"\",\"Res_ProRE[43]\":\"\",\"ExpScore_Score[29]\":-1,\"ExpScore_Value[4]\":\"未知\",\"Res_RuleDesc[26]\":\"\",\"Res_RuleDesc[14]\":\"\",\"Res_RuleDesc[38]\":\"\",\"ExpScore_Score[1]\":9,\"ExpScore_ID[3]\":3,\"ExpScore_Value[17]\":\"未知\",\"ExpScore_Value[29]\":\"\",\"Res_Loan_Time[20]\":\"\",\"Res_Loan_Time[32]\":\"\",\"Res_RuleDesc[8]\":\"\",\"Res_ProRE[14]\":\"\",\"Res_ProRE[15]\":\"\",\"Res_ProRE[27]\":\"\",\"Res_ProRE[39]\":\"\",\"Res_Loan_Time[33]\":\"\",\"Res_Loan_Time[45]\":\"\",\"ExpScore_ID[4]\":4,\"ExpScore_ID[20]\":20,\"ExpScore_Value[28]\":\"\",\"Res_NextOprStep\":\"-99\",\"ExpScore_Value[1]\":\"未知\",\"Res_Loan_Time[31]\":\"\",\"Res_Loan_Time[43]\":\"\",\"ExpScore_Value[16]\":\"≤2个月\",\"Res_ProRE[13]\":\"\",\"Res_ProRE[25]\":\"\",\"Res_RuleDesc[9]\":\"\",\"Res_Loan_Mode[50]\":\"\",\"Res_ProRE[26]\":\"\",\"Res_ProRE[38]\":\"\",\"Res_Loan_Time[44]\":\"\",\"ExpScore_Value[2]\":\"18岁以下\",\"ExpScore_ID[5]\":5,\"ExpScore_ID[21]\":21,\"Res_Loan_Time[30]\":\"\",\"Res_Loan_Time[42]\":\"\",\"ExpScore_Value[15]\":\"未知\",\"ExpScore_Value[27]\":\"\",\"Res_ProRE[12]\":\"\",\"Res_ModePro\":\"人工审批1\",\"Res_ProRE[24]\":\"\",\"Res_ProRE[36]\":\"\",\"Res_ExtBureauCompletionRatio\":0,\"Res_ProRE[37]\":\"\",\"Res_RuleDesc[19]\":\"\",\"Res_ProRE[49]\":\"\",\"ExpScore_ID[6]\":6,\"ExpScore_ID[10]\":10,\"Res_Loan_Time[41]\":\"\",\"ExpScore_Value[14]\":\"＞9成，≤10成\",\"ExpScore_Value[26]\":\"\",\"Res_ProRE[11]\":\"\",\"res_randomnumber[1]\":651,\"Res_ProRE[23]\":\"\",\"Res_ProRE[35]\":\"\",\"Res_ProRE[47]\":\"\",\"Res_ExtBureauList\":\"FFFFFFFFFFFF\",\"ExpScore_ID[22]\":22,\"Res_ProRE[48]\":\"\",\"Res_RuleDesc[18]\":\"\",\"ExpScore_ID[7]\":7,\"Res_SInsuranceDeductions\":0,\"ExpScore_Name[9]\":\"本地居住年限\",\"ExpScore_Score[24]\":-1,\"ExpScore_Score[12]\":10,\"ExpScore_Name[19]\":\"抵押次数\",\"ExpScore_Dimension[13]\":\"稳定性\",\"res_randomnumber[2]\":-99,\"Res_ProRE[19]\":\"\",\"Res_ProRE[2]\":\"\",\"Res_Loan_Time[13]\":\"\",\"Res_Loan_Time[25]\":\"\",\"Res_Loan_Time[37]\":\"\",\"Res_RuleDesc[33]\":\"\",\"Res_RepaymentMode[3]\":\"\",\"Res_Loan_Time[49]\":\"\",\"Res_RuleDesc[21]\":\"\",\"Res_RuleDesc[45]\":\"\",\"Res_ViolationPay\":0,\"ExpScore_Name[8]\":\"与谁同住\",\"Res_RuleDesc[20]\":\"\",\"ExpScore_Score[23]\":-1,\"ExpScore_Score[11]\":5,\"ExpScore_Dimension[14]\":\"还款意愿\",\"Res_TotalDeductions\":0,\"res_randomnumber[3]\":-99,\"Res_ProRE[1]\":\"\",\"Res_ProRE[18]\":\"\",\"Res_Loan_Time[12]\":\"\",\"Res_Loan_Time[24]\":\"\",\"Res_Loan_Time[36]\":\"\",\"Res_RepaymentMode[2]\":\"\",\"Res_Loan_Time[48]\":\"\",\"Res_RuleDesc[32]\":\"\",\"Res_RuleDesc[44]\":\"\",\"ExpScore_ID[1]\":1,\"Res_RuleDesc[31]\":\"\",\"Res_Loan_Mode[19]\":\"\",\"ExpScore_Score[22]\":5,\"Res_Loan_Time[10]\":\"\",\"ExpScore_Score[10]\":25,\"ExpScore_Dimension[11]\":\"稳定性\",\"res_randomnumber[4]\":-99,\"Res_ProRE[17]\":\"\",\"Res_ProRE[29]\":\"\",\"Res_Loan_Time[11]\":\"\",\"Res_Loan_Time[23]\":\"\",\"Res_RepaymentMode[19]\":\"\",\"Res_Loan_Time[35]\":\"\",\"Res_Loan_Time[47]\":\"\",\"Res_RuleDesc[43]\":\"\",\"Res_RepaymentMode[5]\":\"\",\"ExpScore_ID[2]\":2,\"Res_RuleDesc[30]\":\"\",\"Res_RuleDesc[42]\":\"\",\"Res_Loan_Time[21]\":\"\",\"ExpScore_Score[21]\":13,\"Res_ApprovalCategory\":\"人工\",\"res_randomnumber[5]\":-99,\"ExpScore_Dimension[12]\":\"稳定性\",\"Res_ProRE[16]\":\"\",\"ExpScore_Score[9]\":25,\"Res_ProRE[28]\":\"\",\"Res_Loan_Time[22]\":\"\",\"ExpScore_BaseScore\":300,\"Res_Loan_Time[34]\":\"\",\"Res_Loan_Time[46]\":\"\",\"Res_RepaymentMode[4]\":\"\",\"res_randomnumber[6]\":-99,\"ExpScore_Name[5]\":\"工作类型\",\"ExpScore_Score[28]\":-1,\"ExpScore_Score[16]\":16,\"ExpScore_ID[15]\":15,\"ExpScore_Dimension[17]\":\"车辆特征\",\"ExpScore_ID[27]\":27,\"Res_GPSIs\":\"1\",\"Res_ProRE[6]\":\"\",\"Res_RepaymentMode[17]\":\"\",\"ExpScore_Name[27]\":\"\",\"Res_RuleDesc[37]\":\"\",\"Res_RepaymentMode[29]\":\"\",\"ExpScore_Name[15]\":\"陪同贷款人员\",\"Res_RuleDesc[25]\":\"\",\"ExpScore_Score[8]\":9,\"Res_RuleDesc[49]\":\"\",\"Res_Loan_Time[17]\":\"\",\"Res_RuleDesc[13]\":\"\",\"Res_Loan_Time[29]\":\"\",\"res_randomnumber[7]\":-99,\"ExpScore_Dimension[18]\":\"车辆特征\",\"ExpScore_Name[4]\":\"婚姻状况\",\"ExpScore_ID[28]\":28,\"ExpScore_Score[27]\":-1,\"ExpScore_Score[15]\":18,\"ExpScore_ID[16]\":16,\"Res_ProRE[5]\":\"\",\"ExpScore_Name[16]\":\"车辆获得年限\",\"Res_RepaymentMode[18]\":\"\",\"Res_RuleDesc[36]\":\"\",\"Res_RuleDesc[48]\":\"\",\"ExpScore_Score[7]\":10,\"ExpScore_Name[28]\":\"\",\"Res_Loan_Time[16]\":\"\",\"Res_Loan_Time[28]\":\"\",\"Res_RuleDesc[24]\":\"\",\"Res_RuleDesc[12]\":\"\",\"res_randomnumber[8]\":-99,\"Res_RepaymentMode[1]\":\"\",\"res_firstfinaldecision\":\"建议拒绝或押车\",\"ExpScore_Name[7]\":\"现居住类别\",\"ExpScore_Dimension[15]\":\"还款意愿\",\"ExpScore_ID[17]\":17,\"ExpScore_ID[29]\":29,\"ExpScore_Score[26]\":-1,\"ExpScore_Score[14]\":12,\"Res_ProRE[4]\":\"\",\"Res_RepaymentMode[39]\":\"\",\"ExpScore_Score[6]\":6,\"Res_RuleDesc[47]\":\"\",\"ExpScore_Name[29]\":\"\",\"ExpScore_Name[17]\":\"车牌与申请城市情况\",\"Res_Loan_Time[15]\":\"\",\"Res_RuleDesc[11]\":\"\",\"Res_Loan_Time[27]\":\"\",\"Res_RepaymentMode[15]\":\"\",\"Res_Loan_Time[39]\":\"\",\"Res_RuleDesc[35]\":\"\",\"Res_RepaymentMode[27]\":\"\",\"Res_RuleDesc[23]\":\"\",\"res_randomnumber[9]\":-99,\"ExpScore_Score[13]\":15,\"ExpScore_Name[6]\":\"现职单位性质\",\"ExpScore_ID[18]\":18,\"ExpScore_Dimension[16]\":\"车辆特征\",\"ExpScore_Score[25]\":-1,\"Res_AproMaxCreditAmout\":-99,\"Res_ProRE[3]\":\"\",\"ExpScore_ID[19]\":19,\"Res_RepaymentMode[28]\":\"\",\"ExpScore_Score[5]\":17,\"ExpScore_Name[18]\":\"过户次数\",\"Res_Loan_Time[14]\":\"\",\"Res_Loan_Time[26]\":\"\",\"Res_RuleDesc[22]\":\"\",\"Res_Loan_Time[38]\":\"\",\"Res_RuleDesc[10]\":\"\",\"Res_RepaymentMode[16]\":\"\",\"Res_RuleDesc[34]\":\"\",\"Res_RuleDesc[46]\":\"\",\"ExpScore_Dimension[3]\":\"人口特征\",\"Res_Loan_Mode[49]\":\"\",\"Res_Loan_Mode[37]\":\"\",\"Res_Loan_Mode[25]\":\"\",\"Res_Loan_Mode[13]\":\"\",\"ExpScore_Name[1]\":\"性别\",\"Res_RepaymentMode[13]\":\"\",\"ExpScore_Name[23]\":\"\",\"Res_RepaymentMode[25]\":\"\",\"ExpScore_Name[11]\":\"直系亲属通话频次排名（优先配偶，其次父母）\",\"Res_RepaymentMode[37]\":\"\",\"Res_RepaymentMode[49]\":\"\",\"res_highvalueconsume\":\"\",\"Res_admittanceis\":\"1\",\"ExpScore_Dimension[4]\":\"人口特征\",\"Res_Loan_Mode[38]\":\"\",\"Res_Loan_Mode[26]\":\"\",\"Res_Loan_Mode[14]\":\"\",\"ExpScore_Name[12]\":\"互通电话数量\",\"Res_RepaymentMode[14]\":\"\",\"Res_RepaymentMode[26]\":\"\",\"Res_RepaymentMode[38]\":\"\",\"ExpScore_Name[24]\":\"\",\"Res_ProRE[9]\":\"\",\"Res_Loan_Time[19]\":\"\",\"Res_RepaymentMode[11]\":\"\",\"Res_RepaymentMode[23]\":\"\",\"ExpScore_Dimension[5]\":\"还款能力\",\"ExpScore_Name[3]\":\"户籍\",\"Res_Loan_Mode[47]\":\"\",\"Res_Loan_Mode[35]\":\"\",\"Res_Loan_Mode[23]\":\"\",\"Res_RepaymentMode[35]\":\"\",\"Res_Loan_Mode[11]\":\"\",\"Res_RepaymentMode[47]\":\"\",\"ExpScore_Name[25]\":\"\",\"ExpScore_Name[13]\":\"手机归属地\",\"Res_version\":\"320190110\",\"Res_ProRE[8]\":\"\",\"Res_RepaymentMode[12]\":\"\",\"Res_ProRE[7]\":\"\",\"ExpScore_Name[2]\":\"年龄\",\"Res_Loan_Mode[48]\":\"\",\"ExpScore_Dimension[6]\":\"还款能力\",\"ExpScore_Name[26]\":\"\",\"Res_Loan_Mode[36]\":\"\",\"Res_Loan_Mode[24]\":\"\",\"Res_HotTips\":\"新车(非直系亲属间)2个月内只能质押--模型建议为人工审批1\",\"Res_Loan_Mode[12]\":\"\",\"Res_RepaymentMode[24]\":\"\",\"Res_RepaymentMode[36]\":\"\",\"Res_RepaymentMode[48]\":\"\",\"ExpScore_Name[14]\":\"申请贷款成数\",\"Res_Loan_Time[18]\":\"\",\"ExpScore_Score[20]\":22,\"Res_RuleDesc[41]\":\"\",\"Res_Loan_Mode[29]\":\"\",\"Res_Loan_Mode[17]\":\"\",\"ExpScore_Dimension[21]\":\"车辆特征\",\"Res_RepaymentMode[21]\":\"\",\"Res_RepaymentMode[33]\":\"\",\"ExpScore_Dimension[20]\":\"车辆特征\",\"Res_RepaymentMode[45]\":\"\",\"Res_Loan_Mode[6]\":\"\",\"Res_RepaymentMode[7]\":\"\",\"res_flashloanis\":0,\"Res_RuleDesc[40]\":\"\",\"Res_Loan_Mode[18]\":\"\",\"ExpScore_Dimension[22]\":\"车辆特征\",\"ExpScore_Dimension[10]\":\"稳定性\",\"Res_RepaymentMode[10]\":\"\",\"Res_RepaymentMode[22]\":\"\",\"Res_RepaymentMode[34]\":\"\",\"ExpScore_Name[20]\":\"抵押记录\",\"Res_RepaymentMode[6]\":\"\",\"Res_Loan_Mode[7]\":\"\",\"Res_RepaymentMode[46]\":\"\",\"ExpScore_Score[30]\":-1,\"Res_Loan_Mode[39]\":\"\",\"Res_JInsuranceDeductions\":0,\"Res_RepaymentMode[31]\":\"\",\"Res_RepaymentMode[43]\":\"\",\"ExpScore_Name[21]\":\"解押天数\",\"ExpScore_Dimension[1]\":\"人口特征\",\"Res_Loan_Mode[27]\":\"\",\"Res_Loan_Mode[15]\":\"\",\"Res_Loan_Mode[8]\":\"\",\"Res_RepaymentMode[9]\":\"\",\"Res_RuleDesc[50]\":\"\",\"Res_Loan_Mode[28]\":\"\",\"Res_RepaymentMode[20]\":\"\",\"Res_RepaymentMode[32]\":\"\",\"Res_RepaymentMode[44]\":\"\",\"ExpScore_Name[10]\":\"手机在网时长\",\"ExpScore_Dimension[2]\":\"人口特征\",\"Res_Loan_Mode[16]\":\"\",\"Res_RepaymentMode[8]\":\"\",\"Res_Loan_Mode[9]\":\"\",\"ExpScore_Name[22]\":\"评估价\",\"Res_ProRE[50]\":\"\",\"ExpScore_Value[13]\":\"本市\",\"Res_Loan_Mode[2]\":\"\",\"ExpScore_Value[25]\":\"\",\"Res_EvaViclePrice\":0,\"Res_Loan_Time[2]\":\"\",\"Res_Loan_Mode[41]\":\"\",\"Res_Antifraud_Score\":-99,\"Res_LTV\":0,\"res_randomnumber[10]\":-99,\"Res_RepaymentMode[41]\":\"\",\"Res_Loan_Mode[3]\":\"\",\"ExpScore_Value[24]\":\"\",\"ExpScore_Value[12]\":\"未获取成功\",\"Res_Loan_Time[1]\":\"\",\"Res_Loan_Mode[30]\":\"\",\"Res_RepaymentMode[42]\":\"\",\"Res_RepaymentMode[30]\":\"\",\"Res_Loan_Mode[42]\":\"\",\"Res_Loan_Time[4]\":\"\",\"Res_Loan_Mode[4]\":\"\",\"ExpScore_Value[11]\":\"未获取成功\",\"ExpScore_Value[23]\":\"\",\"ExpScore_ID[30]\":30,\"Res_Loan_Mode[5]\":\"\",\"ExpScore_Value[10]\":\"未获取成功\",\"ExpScore_Value[22]\":\"未知\",\"Res_Loan_Time[3]\":\"\",\"ExpScore_Name[30]\":\"\",\"Res_Loan_Mode[40]\":\"\",\"Res_RepaymentMode[40]\":\"\",\"Res_Loan_Time[6]\":\"\",\"ExpScore_Value[21]\":\"0天\",\"Res_ProRE[30]\":\"\",\"Res_ProRE[42]\":\"\",\"Res_ModeLTV\":0,\"ExpScore_Dimension[7]\":\"稳定性\",\"Res_Loan_Mode[45]\":\"\",\"Res_Loan_Mode[33]\":\"\",\"ExpScore_Value[9]\":\"未知\",\"Res_Loan_Mode[21]\":\"\",\"Res_Loan_Time[5]\":\"\",\"Res_RuleDesc[1]\":\"\",\"ExpScore_Value[20]\":\"\uFEFF其他\",\"Res_ProRE[41]\":\"\",\"Res_RepaymentMode[50]\":\"\",\"Res_Loan_Mode[46]\":\"\",\"ExpScore_Dimension[8]\":\"稳定性\",\"Res_Loan_Mode[34]\":\"\",\"Res_Loan_Mode[22]\":\"\",\"Res_Loan_Mode[10]\":\"\",\"Res_RuleDesc[2]\":\"R217--风险提示II--购车时间小于3个月+（在网时长<6个月或静默时间大于30天）\",\"Res_Loan_Time[8]\":\"\",\"Res_EvaPZIS\":\"2\",\"Res_ProRE[40]\":\"\",\"Res_RELTV\":-99,\"ExpScore_Dimension[9]\":\"稳定性\",\"Res_Loan_Mode[43]\":\"\",\"Res_Loan_Mode[31]\":\"\",\"ExpScore_Value[7]\":\"未知\",\"Res_Loan_Time[7]\":\"\",\"Res_RE\":0,\"Res_Loan_Mode[1]\":\"\",\"Res_RuleDesc[3]\":\"\",\"ExpScore_Value[30]\":\"\",\"Res_SiteCategory\":\"B\",\"ExpScore_Value[8]\":\"未知\",\"Res_Loan_Mode[44]\":\"\",\"Res_Loan_Mode[32]\":\"\",\"Res_Loan_Mode[20]\":\"\"}";
        JSONObject jsonObject = JSONObject.parseObject(jsonstr);
        long startTime = System.currentTimeMillis();
        Set<String> jsonKey = jsonObject.keySet();
        Iterator iterator = jsonObject.keySet().iterator();
        while (iterator.hasNext()) {
            String key =(String)iterator.next();
            if(key.contains("ExpScore_Name")){
                Object val = jsonObject.get(key);
                System.out.println("key:"+key+"|value:"+val);
            }
        }

        long endTime = System.currentTimeMillis();
        System.out.println("耗时:"+(endTime-startTime));
        String exce = "$.Res_AnnualPay";
        Object object = JSONPath.eval(jsonObject, exce);
        System.out.println(object);
    }

}
